package com.kele.controller;

import com.kele.domain.Order;
import com.kele.domain.User;
import com.kele.service.OrderService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

/**
 * @author 赵奥林
 * @date 2021年06月02日 9:40
 * @Description 页面跳转控制器   有的可以不使用行为跳转。直接html页面也可。
 */
@Controller
@RequestMapping("/to")
public class jumpController {

    @Resource
    private OrderService orderService;

    /**
     * 跳转到文章管理页面
     * @return
     */
    @RequestMapping("/toArticle")
    public String  toArticle(){
        return "/static_resources/templates/article";
    }

    /**
     * 跳转到分类页面
     * @return
     */
    @RequestMapping("/toClassify")
    public String toClassify(){
        return "/static_resources/templates/classify";
    }

    /**
     * 跳转到文章管理页面
     * @return
     */
    @RequestMapping("/toContentManagement")
    public String toContentManagement(){
        return "/static_resources/templates/contentManagement";
    }

    /**
     * 跳转到登陆页面
     * @return
     */
    @RequestMapping("/toLogin")
    public String toLogin(){
        return "/static_resources/templates/login";
    }

    /**
     * 跳转到用户管理页面
     * @return
     */
    @RequestMapping("/toManagement")
    public String toManagement(){
        return "/static_resources/templates/management";
    }

    /**
     * 跳转到我的收藏页面
     * @return
     */
    @RequestMapping(value = "/toMyCollect",method = RequestMethod.GET)
    public String toMyCollect(){
        return "/static_resources/templates/myCollect";
    }

    /**
     * 跳转到个人中心页面
     * @return
     */
    @RequestMapping("/toPeopleCenter")
    public String toPeopleCenter(HttpServletRequest request, Model model){
        User user= (User) request.getSession().getAttribute("User");
        model.addAttribute("user",user);
        return "/static_resources/templates/peopleCenter";
    }

    /**
     * 跳转到评论管理页面
     * @return
     */
    @RequestMapping("/toPicture")
    public String toPicture(){
        return "/static_resources/templates/picture";
    }

    /**
     * 跳转到阅读博客页面
     * @return
     */
    @RequestMapping("/toRead")
    public String toRead(){
        return "/static_resources/templates/read";
    }

    /**
     * 跳转到搜索页面
     * @return
     */
    @RequestMapping("/toSearch")
    public String toSearch(){

        return "/static_resources/templates/search";
    }

    /**
     *跳转到瀑布流页面
     * @return
     */
    @RequestMapping("/toSelectImages")
    public String toSelectImages(){
        return "/static_resources/templates/selectImages";
    }

    /**
     *跳转到使用条款页面
     * @return
     */
    @RequestMapping("/toTermsOfUse")
    public String toTermsOfUse(){
        return "/static_resources/templates/termsOfUse";
    }

    /**
     * 跳转到vip中心
     * @return
     */
    @RequestMapping("/toVipCenter")
    public String toVipCenter(){
        return "/static_resources/templates/vipCenter";
    }

    /**
     * 跳转到创作中心
     * @return
     */
    @RequestMapping("/toWrite")
    public String toWrite(){
        return "/static_resources/templates/write";
    }
    @RequestMapping("/other")
    public String other(){
        return "/static_resources/templates/five_fives1";
    }
    @RequestMapping("/error")
    public String Error(){
        return "static_resources/templates/five_fives";
    }
    @RequestMapping(value = "/toPerfect")
    public String toPerfect(){
        return "/static_resources/templates/nickName";

    }
    @RequestMapping(value = "/toSetting",method = RequestMethod.GET)
    public String toSetting(){
        return "static_resources/templates/accountSetting";
    }
//    @RequestMapping(value = "/toPerfect")
//    public String toPerfect(){
//        return "/static_resources/templates/nickName";
//
//    }
}
